<template>
  <sapn>双倍 count {{ doubleCount }}</sapn>
  <span>count is {{ count }}</span>
  <button @click="count++">增加count</button>
</template>

<script setup lang="js">
import {ref, computed, watch} from 'vue'

const count = ref(0)

watch(count, (newValue, oldValue) => {
  console.log(`count is ${newValue}, old value is ${oldValue}`)
})


const doubleCount = computed(() => {
  return count.value * 2
})
</script>

<style scoped>

</style>